package vn.edu.hcmut.cse.ai.infrastructure;

public abstract class Problem {
    // The intial state of the problem
    protected Object initialState;
    
    // The actions corresponding to the problem
    protected Actions actions;
    
    // Check if the current state is the goal state
    protected GoalTest goalTest;
 
    // The cost from one state to another next state
    protected ActionCost actionCost;
    
    public Problem(Object initialState, Actions actions, GoalTest goalTest, ActionCost actionCost) {
        this.initialState = initialState;
        this.actions = actions;
        this.goalTest = goalTest;
        this.actionCost = actionCost;
    }
    
    // Implement this to return a node with an action
    public abstract Node getChildNode(Node node, Action action);

    public Object getInitialState() {
        return initialState;
    }

    public void setInitialState(Object initialState) {
        this.initialState = initialState;
    }

    public Actions getActions() {
        return actions;
    }

    public void setActions(Actions actions) {
        this.actions = actions;
    }

    public GoalTest getGoalTest() {
        return goalTest;
    }

    public void setGoalTest(GoalTest goalTest) {
        this.goalTest = goalTest;
    }

    public ActionCost getActionCost() {
        return actionCost;
    }

    public void setActionCost(ActionCost actionCost) {
        this.actionCost = actionCost;
    }
}
